package IC.AST.nodes;

import IC.AST.*;

/**
 * an assignment statement
 */
public class AssignStmt extends Statement {
	private Expression src;	// the r-value
	private Variable dest;	// the l-value

	/**
	 * @param src the r-value
	 * @param dest the l-value
	 * @param fileName TODO
	 * @param line the node line number
	 * @param column the node column number
	 */
	public AssignStmt(Expression src, Variable dest, String fileName, int line, int column) {
		super(fileName, line,column);
		this.src = src;
		this.dest = dest;
	}

	/**
	 * @return the r-value
	 */
	public Expression getSrc() {
		return this.src;
	}

	/**
	 * @return the l-value
	 */
	public Variable getDest() {
		return this.dest;
	}

	public <D,U> U accept(PropogatingVisitor<D,U> v, D context) throws Exception {
		return v.visit(this,context);
	}
}
